<?php

namespace Proj\ResManBundle\Entity;

use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;

/**
 * Users
 *
 * @ORM\Table(name="fos_user")
 * @ORM\Entity(repositoryClass="Proj\ResManBundle\Repository\UserRepository")
 */
class User extends BaseUser {

    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    protected $id;

    /**
     * @var string $creation_date
     * @ORM\Column(name="creation_date", type="datetime", unique=false, nullable=false) 
     */
    protected $creation_date;

    /**
     * @var string $account_status
     * @ORM\Column(name="account_status", type="boolean", unique=false, nullable=false) 
     */
    protected $account_status;
    
    /**
     *
     * @var Person
     * 
     * @ORM\OneToOne(targetEntity="Person", mappedBy="user") 
     */
    protected $person;

    public function __construct()
    {
        parent::__construct();
        $this->creation_date = new \DateTime('NOW');
        $this->account_status = true;
        
    }
    
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set creation_date
     *
     * @param \DateTime $creationDate
     * @return User
     */
    public function setCreationDate($creationDate)
    {
        $this->creation_date = $creationDate;
    
        return $this;
    }

    /**
     * Get creation_date
     *
     * @return \DateTime 
     */
    public function getCreationDate()
    {
        return $this->creation_date;
    }

    /**
     * Set account_status
     *
     * @param boolean $accountStatus
     * @return User
     */
    public function setAccountStatus($accountStatus)
    {
        $this->account_status = $accountStatus;
    
        return $this;
    }

    /**
     * Get account_status
     *
     * @return boolean 
     */
    public function getAccountStatus()
    {
        return $this->account_status;
    }

    /**
     * Set person
     *
     * @param \Proj\ResManBundle\Entity\Person $person
     * @return User
     */
    public function setPerson(\Proj\ResManBundle\Entity\Person $person = null)
    {
        $this->person = $person;
    
        return $this;
    }

    /**
     * Get person
     *
     * @return \Proj\ResManBundle\Entity\Person 
     */
    public function getPerson()
    {
        return $this->person;
    }
}
